// @ts-check
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';

import { baseConfig } from '../../eslint.config.mjs';

export default tseslint.config({
  // 先应用基础配置
  ...baseConfig,
  ignores: [...baseConfig.ignores, 'dist/**', '.stylelintrc.mjs'],
  plugins: {
    ...baseConfig.plugins,
    'react-hooks': reactHooks,
    'react-refresh': reactRefresh
  },
  settings: {
    'import/resolver': {
      typescript: {
        project: './tsconfig.json'
      }
    }
  },
  rules: {
    ...baseConfig.rules,
    // 启用React Hooks规则
    ...reactHooks.configs['recommended-latest'].rules,
    // 启用React Refresh规则
    ...reactRefresh.configs.vite.rules
  }
});
